using Fusion.Async.Timers;
using System;
using UnityEngine;

namespace Fusion.Frameworks.UI
{
    [DisallowMultipleComponent]
    public class UIExecutor : MonoBehaviour
    {
        public event Action StartEvent;

        // Start is called before the first frame update
        void Start()
        {
            gameObject.SetActive(false);
            TimerManager.Instance.InvokeEndOfFrame(StartEvent);
        }

        private void OnDestroy()
        {
            StartEvent = null;
        }
    }
}

